<template>
  <div>
    <h1>我是about</h1>
    {{ $store.state.name }}
    <button @click="change">更改数据</button>
    <hr />
    {{ $store.state.num }}
    <button @click="add(1)">+1</button>
    <button @click="add(3)">+3</button>
    <button @click="add(5)">+5</button>
    <hr>
    
  </div>
</template>

<script>
export default {
  methods: {
    change() {
      this.$store.commit("changeName");
    },
    add(value){
      this.$store.commit("add",value);
    }
  },
};
</script>

<style>
</style>